/* eslint-disable new-cap */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from 'path'
import Components from 'unplugin-vue-components/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'

export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()]
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  server: {
    port: 3000,
    hmr: {
      host: '127.0.0.1',
      port: 3000
    },
    proxy: {
      '/api': {
        target: 'localhost:7001',
        changeOrigin: true
      }
    }
  }
})
